<template>
    <div clsss="Prefile">
      <mheader></mheader>
      <Swiper :slider="swiperList"></Swiper>
      <Icon :icons="icons"></Icon>
      <hot :hot="recommendList"></hot>
      <run :weblist="weblist"></run>

    </div>
</template>

<script>
  import mheader from '../../components/mheader.vue'
  import Swiper from '../../components/swiper.vue'
  import Icon from '../../components/Icon.vue'
  import Hot from '../../components/Hot.vue'
  import Run from '../../components/Run.vue'
  import {getData} from '../../api'
    export default {
        data() {
            return {
                icons:[],  // 列表数据
                weblist:[], // 周末去哪玩
                swiperList:[], // 轮播
                recommendList:[] // 热门推荐
            }
        },
      components:{
        mheader,
        Swiper,
        Icon,
        Hot,
        Run
      },
      methods:{
        async getAll(){
         let all = await getData();
         console.log(all)
         this.recommendList = all.data.recommendList;
         this.swiperList = all.data.swiperList;
         this.icons = all.data.iconList;
         this.weblist = all.data.weekendList
        }
      },
      created(){
        this.getAll()
      }
    }
</script>

<style lang="stylus" ref="stylesheet/stylus" scoped>

</style>
